<template>
  <!-- (备注说明)标题/描述切换 -->
  <ButtonGroup title="类型说明" :status="status[currentStatus]">
    <!-- 按钮组 -->
    <el-button-group>
      <el-button
        :class="{
          select: currentStatus === 0,
        }"
        @click="changeType(0)"
      >
        <font-awesome-icon icon="heading" />
      </el-button>
      <el-button
        :class="{
          select: currentStatus === 1,
        }"
        @click="changeType(1)"
      >
        <font-awesome-icon icon="paragraph" />
      </el-button>
    </el-button-group>
  </ButtonGroup>
</template>

<script setup lang="ts">
import { inject } from 'vue'
import ButtonGroup from './ButtonGroup.vue'
import type { VueComType, UpdateStatus } from '@/types'
const props = defineProps<{
  currentStatus: number
  status: string[]
  isShow: boolean
  configKey: string
  editCom: VueComType
}>()
const updateStatus = inject<UpdateStatus>('updateStatus')
const changeType = (index: number) => {
  if (updateStatus) updateStatus(props.configKey, index)
}
</script>

<style scoped></style>
